<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

/*Route::get('/', function () {
    return view('welcome');
});
*/

//前台页面路由
//主页
Route::get('/', 'Home\IndexController@index');

//男士手表页面
Route::get('/boys', 'Home\IndexController@boys');

//女士手表页面
Route::get('/girls', 'Home\IndexController@girls');

// 详情页
Route::get('/detail', 'Home\IndexController@detail');

//购物车路由
Route::get('/cart', 'Home\IndexController@cart');

//订单页路由
Route::get('/account', 'Home\IndexController@account');

//个人中心
Route::get('/usercenter', 'Home\UserController@userCenter');

//个人资料
Route::get('/home/personal', 'Home\PersonalController@personalDataView');

//加载个人资料修改页面
Route::get('/home/personaledit', 'Home\PersonalController@personalDataEdit');

//修改个人资料
Route::post('/home/personaldataupdata', 'Home\PersonalController@personalDataUpdata');

//加载修改密码页面
Route::get('/home/personalpassword', 'Home\PersonalController@personalPasswordEdit');

//处理修改密码
Route::post('/home/personalpasswordupdate', 'Home\PersonalController@personalPasswordUpdata');

//登录页面
Route::get('/login', 'Home\UserController@loginView');

//处理登录
Route::post('/home/dologin', 'Home\UserController@doLogin');

//执行用户退出
Route::get('/home/loginout', 'Home\UserController@loginOut');

//注册页面
Route::get('/register', 'Home\UserController@registerView');

//前台注册验证处理
Route::post('/home/doregister', 'Home\UserController@doRegister');

Route::post('/home/phonecode', 'Home\UserController@phoneCode');

//前台注册数据新增处理
Route::post('/home/addregisterdata', 'Home\UserController@addRegisterData');



//后台页面路由
Route::get('admin/index', function () {
    return view('Admin/index');
});

//公用验证码
Route::get('/makecode', 'Api\CommonApi@buildCode');

//文件上传的路由
Route::post('/upload', 'Api\CommonApi@upload');


//收货地址页面 资源路由
Route::prefix('home')->group(function () {

    Route::resource('address', 'Home\AddressController');
    Route::get('address/{id}/edit', 'Home\AddressController@edit');


});

